"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var router_1 = require('@angular/router');
var bearing_service_1 = require('../scheme/bearing.service');
var BearingListComponent = (function () {
    function BearingListComponent(bearingService, route, router) {
        this.bearingService = bearingService;
        this.route = route;
        this.router = router;
    }
    Object.defineProperty(BearingListComponent.prototype, "routeAnimation", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BearingListComponent.prototype, "display", {
        get: function () {
            return 'block';
        },
        enumerable: true,
        configurable: true
    });
    ;
    BearingListComponent.prototype.onChoose = function (bear) {
        this.selectedBear = bear;
        this.router.navigate([bear.id], { relativeTo: this.route });
    };
    ;
    BearingListComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.bearingService.getBearing().then(function (result) {
            _this.bears = result;
        });
    };
    ;
    __decorate([
        core_1.HostBinding('@routeAnimation'), 
        __metadata('design:type', Object)
    ], BearingListComponent.prototype, "routeAnimation", null);
    __decorate([
        core_1.HostBinding('style.display'), 
        __metadata('design:type', Object)
    ], BearingListComponent.prototype, "display", null);
    BearingListComponent = __decorate([
        core_1.Component({
            moduleId: module.id,
            selector: 'my-bearing-list',
            templateUrl: 'bearing-list.component.html',
            animations: [
                core_1.trigger('routeAnimation', [
                    core_1.state('*', core_1.style({
                        opacity: 1,
                        transform: 'translateX(0)'
                    })),
                    core_1.transition('void => *', [
                        core_1.style({
                            opacity: 0,
                            transform: 'translateX(-15%)'
                        }),
                        core_1.animate('0.35s ease-in-out')
                    ])
                ])
            ]
        }), 
        __metadata('design:paramtypes', [bearing_service_1.BearingService, router_1.ActivatedRoute, router_1.Router])
    ], BearingListComponent);
    return BearingListComponent;
}());
exports.BearingListComponent = BearingListComponent;
